Skip to content

refactor(TAA): readable variable names + named constants#90

Closed
alandtse wants to merge 1 commit into
devfrom
refactor/taa-readable-vars
Closed

refactor(TAA): readable variable names + named constants#90
alandtse wants to merge 1 commit into
devfrom
refactor/taa-readable-vars

Conversation

@alandtse
Copy link
Copy Markdown
Owner

@alandtse alandtse commented Jun 3, 2026

Behavior-preserving readability pass on the ISTemporalAA.hlsl decompile transcription. Supersedes #85 (its constants + alpha-loop commits are included here) — folded into one cohesive PR.

What changed (all bytecode-identical)

  1. Named constants for repeated magic literals: kMaxLumaCap, kMinLumaCap, kLumaEpsilon, kSimilarityScale.
  2. Alpha-coverage loop replacing eight near-identical AlphaCoverageMask(...) ? x : 0 lines.
  3. Real variable names for clean register lifetimes: centerLuma, centerColor, neighborColor, motionLength, motionConfidence, motionNormScale, feedbackWeight, depthMaskPass, allTransparent, centerCoverage, uvMinCoverage, uvMinBelowHist, outputLuma, resolved, flickerScore, historyBlend, clampToNeighborhood, reject.

Proven safe

Every step gated by tools/verify-shader-refactor.ps1 (#86): compiled DXBC is byte-identical (SHA-256) to the pre-refactor revision across all four permutations (flat / VR / HDR / VR+HDR). No math, swizzle, control-flow, or #ifdef changes. Also deployed + spot-checked in-game.

Out of scope (Standard B, separate follow-up)

The dense bracket-selection cascade and flicker bubble-passes stay as register packs — restructuring those into helpers/loops diverges bytecode and needs runtime A/B validation; tracked separately, ideally upstreamed.

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Warning

Review limit reached

@alandtse, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 29 minutes and 17 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bea7a29d-b8e8-4924-a47f-3500b2a163ac

📥 Commits

Reviewing files that changed from the base of the PR and between a47f46b and a02a2f9.

📒 Files selected for processing (1)
  • package/Shaders/ISTemporalAA.hlsl
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/taa-readable-vars

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

No actionable suggestions for changed features.

@alandtse alandtse changed the title refactor(TAA): name clean register lifetimes in main() refactor(TAA): readable variable names + named constants (provably no-op) Jun 3, 2026
@alandtse alandtse changed the base branch from refactor/taa-constants-alpha-loop to dev June 3, 2026 06:23
@alandtse alandtse changed the title refactor(TAA): readable variable names + named constants (provably no-op) refactor(TAA): readable variable names + named constants Jun 3, 2026
Copilot AI review requested due to automatic review settings June 3, 2026 07:01
@alandtse alandtse force-pushed the refactor/taa-readable-vars branch from c5d6cdb to abc26a0 Compare June 3, 2026 07:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Readability-focused refactor of the ISTemporalAA.hlsl decompile transcription, aiming to keep the shader behavior/compiled output unchanged while making the code easier to follow and maintain.

Changes:

  • Introduces named constants for repeated “magic” literals used in luma clamping/thresholding and similarity scaling.
  • Replaces repeated alpha-coverage gating statements with a compact unrolled loop.
  • Renames key intermediate values (e.g., center/neighbor luma/color, motion metrics, flicker/history blend factors) to better communicate intent and register lifetimes.


static const float3 kLumaWeights = float3(0.5, 0.25, 0.25);

// Named magic constants from the vanilla decompile (values unchanged).
Copilot AI review requested due to automatic review settings June 3, 2026 10:24
@alandtse alandtse force-pushed the refactor/taa-readable-vars branch from 2e5df5f to a02a2f9 Compare June 3, 2026 10:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


static const float3 kLumaWeights = float3(0.5, 0.25, 0.25);

// Named magic constants from the vanilla decompile (values unchanged).
@alandtse
Copy link
Copy Markdown
Owner Author

alandtse commented Jun 3, 2026

Consolidated into #98, which now targets dev directly with the full ISTemporalAA refactor (readable vars + core restructure + register-pack destructure).

@alandtse alandtse closed this Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants